import { defHttp } from '@/utils/http/axios';
import { ErrorMessageMode } from '#/axios';
import { LoginLogQueryType, SysLogQueryType } from "@/api/log/modal/SysLogType";

enum Api {
  //获取操作日志列表
  GetSysLogList = '/log/sysLogList',
  //获取登录日志列表
  GetLoginLogList = '/log/loginLogList',
  //删除操作日志
  DeleteSysLog = '/log/deleteSysLog',
  //删除登录日志
  DeleteLoginLog = '/log/deleteLoginLog',
}
export const GetSysLogList = (params:SysLogQueryType) => {
  return defHttp.get<any>({ params:params, url: Api.GetSysLogList });
}
export const GetLoginLogList = (params:LoginLogQueryType) => {
  return defHttp.get<any>({ params:params, url: Api.GetLoginLogList });
}
export const DeleteSysLog = ( mode: ErrorMessageMode = 'message') => {
  return defHttp.delete<any>({ url: Api.DeleteSysLog },
    {
      errorMessageMode: mode,
    });
}
export const DeleteLoginLog = (mode: ErrorMessageMode = 'message') => {
  return defHttp.delete<any>({ url: Api.DeleteLoginLog },
    {
      errorMessageMode: mode,
    });
}
